package com.bstek.demo;

import ch.qos.logback.core.PropertyDefinerBase;
import org.springframework.stereotype.Component;

import java.net.InetAddress;
import java.net.UnknownHostException;

@Component
public class NodeIPProperty extends PropertyDefinerBase {
    private static String nodeIP;

    static {
        try {
            nodeIP = InetAddress.getLocalHost().getHostAddress();

        } catch (UnknownHostException e) {
            e.printStackTrace();
        }
    }

    @Override
    public String getPropertyValue() {
        return NodeIPProperty.nodeIP;
    }

}
